package com.cn.zengzeng.spbzengzeng.utils;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;

import javax.annotation.Resource;

/**
 * @Description:
 * @Author: zhangzengzeng
 * @Date: 2021/10/9 10:03
 */
@Component
public class RedisUtilsImpl implements RedisUtils{
    @Resource
    private Jedis jedis;
    @Override
    public String set (String key,String value) {
        return jedis.set(key,value);
    }

    @Override
    public String get (String Key) {
        return jedis.get(Key);
    }

    @Override
    public String setex (String key,Integer seconds,String value) {
        return jedis.setex(key,seconds,value);
    }

    @Override
    public long ttl (String key) {
        return jedis.ttl(key);
    }

    @Override
    public long expire (String key,Integer seconds) {
        return jedis.expire(key,seconds);
    }

    @Override
    public Long hset (String key,String filed,String value) {
        Long hset = jedis.hset(key,filed,value);
        return hset;
    }

    @Override
    public String hget (String key,String field) {
        return jedis.hget(key,field);
    }

    @Override
    public Long delete (String key) {
        return jedis.del(key);
    }
}
